﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db;
using HengTong.Model._Admin;
using HengTong.Model.Db.Other;


namespace HengTong.ViewModel.Visitor.SysVisitorInformationVms
{
    public partial class SysVisitorInformationTemplateVm : BaseTemplateVM
    {
        [Display(Name = "姓名")]
        public ExcelPropety NameExcel = ExcelPropety.CreateProperty<SysVisitorInformation>(x => x.Name);
        [Display(Name = "手机号")]
        public ExcelPropety PhoneExcel = ExcelPropety.CreateProperty<SysVisitorInformation>(x => x.Phone);
        [Display(Name = "身份证号")]
        public ExcelPropety IdCardNoExcel = ExcelPropety.CreateProperty<SysVisitorInformation>(x => x.IdCardNo);
        [Display(Name = "所属单位/公司")]
        public ExcelPropety CompanyExcel = ExcelPropety.CreateProperty<SysVisitorInformation>(x => x.Company);
        [Display(Name = "车牌号")]
        public ExcelPropety CarNoExcel = ExcelPropety.CreateProperty<SysVisitorInformation>(x => x.CarNo);
        [Display(Name = "绑定用户")]
        public ExcelPropety UserExcel = ExcelPropety.CreateProperty<SysVisitorInformation>(x => x.UserId);
        [Display(Name = "备注信息")]
        public ExcelPropety RemarkExcel = ExcelPropety.CreateProperty<SysVisitorInformation>(x => x.Remark);
        [Display(Name = "黑名单状态")]
        public ExcelPropety BlackStatusExcel = ExcelPropety.CreateProperty<SysVisitorInformation>(x => x.BlackStatus);
        [Display(Name = "黑名单原因")]
        public ExcelPropety BlackReasonExcel = ExcelPropety.CreateProperty<SysVisitorInformation>(x => x.BlackReason);

	    protected override void InitVM()
        {
            UserExcel.DataType = ColumnDataType.ComboBox;
            UserExcel.ListItems = DC.Set<FrameworkUser>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysVisitorInformationImportVm : BaseImportVM<SysVisitorInformationTemplateVm, SysVisitorInformation>
    {

    }

}
